package online.xuping.center.account.impl;

import online.xuping.center.account.ITradeTypeService;
import online.xuping.center.account.domain.AccountTypeDomain;
import online.xuping.center.account.domain.TradeType;
import online.xuping.common.SettingUtil;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 交易类型设置
 */
@Service
public class TradeTypeServiceImpl implements ITradeTypeService {

    @Override
    public List<TradeType> findTradeType() {
        List<String> list = SettingUtil.getList("config/account.setting", "tradeType");
        List<TradeType> re  = new ArrayList();
        list.stream().forEach(it->{
            re.add(TradeType.builder().tradeTypeName(it).build());
        });
        return re;
    }
}
